package tw.asap.plus.entity.request;

import android.os.Build;
import android.os.Parcel;
import android.os.Parcelable;

import tw.asap.plus.app.NearApplication;
import tw.asap.plus.common.ConstValue;
import tw.asap.plus.entity.User;
import tw.asap.plus.utils.NetUtil;
import tw.asap.plus.utils.SPUtil;

/**
 * Description:
 * Created:      [15/11/9]
 * Author:       [Yang]
 **/
public class CommonRequestParams {

    public String app_id;
    public String req_time;
    public String clientv;
    public String imei;
    public String systemv;
    public String push_id;
    public String channel;
    public String net_type;
    public String token;

    public CommonRequestParams() {
        SPUtil spUtil = SPUtil.getInstance(NearApplication.getNearApplicationContext());
        app_id = spUtil.getString(ConstValue.Sp.APP_ID, "");
        req_time = String.valueOf(System.currentTimeMillis());
        clientv = spUtil.getString(ConstValue.Sp.APP_VERSION, "");
        imei = spUtil.getString(ConstValue.Sp.IMEI_NO, "");
        systemv = Build.VERSION.SDK;
        push_id = spUtil.getString(ConstValue.Sp.PUSH_ID, "");
        channel = spUtil.getString(ConstValue.Sp.CHANNEL, "");
        net_type = NetUtil.isWifiConnect(NearApplication.getNearApplicationContext()) ? "wifi" : "3g";
        token = User.getUserToken();
    }
}
